import java.util.Arrays;
import java.util.Scanner;
public class array {

    public static void main(String[] args) {
        int[][] array = new int[2][];
        array[0]=new int[3];
        array[1]=new int[5];
        for (int i = 0; i < array.length; i++) {
            for (int j = 0; j < array[i].length; j++) {
                System.out.print(array[i][j]+" ");
            }
            System.out.println();
        }
    }

    public static void main8(String[] args) {
        int[][] array = new int[3][];
        System.out.println(array[0]);
    }

    public static void main7(String[] args) {
        int[] array={4,1,2,1,2};
        int num=getNum(array);
        System.out.println(num);
    }
    public static int getNum(int[] array){
        int ret=0;
        for (int i = 0; i < array.length; i++) {
            ret^=array[i];
        }
        return ret;
    }
    public static void main6(String[] args) {
        int[] array={1,2,3,4,5,6};
        change(array);
        for (int x: array) {
            System.out.print(x+" ");
        }
    }

    public static void change(int[] array){
        int left=0;
        int right=array.length-1;
        while(left<right){
            while(left<right&&array[left]%2!=0){
                left++;
            }
            while(left<right&&array[right]%2==0){
                right--;
            }
            int tmp=array[left];
            array[left]=array[right];
            array[right]=tmp;
        }
    }
    public static void main5(String[] args) {
        int[] array={1,2,3,4,5,6};
        reverse(array);
        for (int x: array) {
            System.out.print(x+" ");
        }
    }

    public static void reverse(int[] array){
        int left=0;
        int right=array.length-1;
        while(left<right){
            int tmp=array[left];
            array[left]=array[right];
            array[right]=tmp;
            left++;
            right--;
        }
    }
    public static void main4(String[] args) {
        int[] array={4,6,3,2,1,7,8,11,23,22,42,21};
        Arrays.sort(array);
        for (int x: array) {
            System.out.print(x+" ");
        }
    }
    public static void bubbleSort(int[] array){
        for(int i=0;i<array.length-1;i++){
            boolean flg=false;
            for (int j = 0; j < array.length-1-i; j++) {
                if(array[j]>array[j+1]){
                    int tmp=array[j];
                    array[j]=array[j+1];
                    array[j+1]=tmp;
                    flg=true;
                }
            }
            if(!flg){
                return;
            }
        }
    }
    public static void main3(String[] args) {
        int[] array={1,2,3,4,5,6};
        int[] array1=Arrays.copyOf(array,array.length);
        //扩容操作
        int[] array2=Arrays.copyOf(array,array.length*2);
        int[] array3=Arrays.copyOfRange(array,2,5);
        String ret1=Arrays.toString(array1);
        System.out.println(ret1);
        String ret2=Arrays.toString(array2);
        System.out.println(ret2);
        String ret3=Arrays.toString(array3);
        System.out.println(ret3);
    }


    public static void main2(String[] args) {
        int[] array={1,2,3,4,5,6};
        String ret=Arrays.toString(array);
        System.out.println(ret);
    }
    public static void main1(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int[] array = {2,6,4,1};
        System.out.println(sequence(array));
    }

    public static boolean sequence(int[] array) {
        boolean flag = true;
        int count=0;
        for (int i = 0; i <array.length-3 ; i++) {
            if(array[i]%2!=0){
                count++;
                if(count==3){
                    return true;
                }
            }else{
                count=0;
            }

        }

        return false;
    }
}
